package com.zhouxiaoge.io.warehouse1;

import javax.naming.Context;
import javax.naming.InitialContext;


public class WarehouseServer {
    public static void main(String[] args) throws Exception {
        System.out.println("Constructing server implementation...");
        WarehouseImpl centralWarehouse = new WarehouseImpl();

//        System.out.println("Binding server implementation to registry...");
//        LocateRegistry.createRegistry(8888);
//        Naming.bind("rmi://localhost:8888/central_warehouse", centralWarehouse);


        Context namingContext = new InitialContext();
        namingContext.bind("rmi:central_warehouse", centralWarehouse);

        System.out.println("Waiting for invocations from clients...");
    }
}
